import java.util.Scanner;


public class Test2 {

	public static void main(String[] args) {
		
		Scanner input = new Scanner(System.in);
		
		System.out.println("请输入一个3位整数:");
		
		int number = input.nextInt();
		
		//获取百位上的数
		int b = number/100;
		//获取十位上的数
		int s = (number%100)/10;
		//获取个位上的数
		int g = number%10;
		
		int sum = b+s+g;
		
		System.out.println(sum);
		
	}
	
}
